package com.fengchao.api.dao.usr;

import com.fengchao.api.dao.BaseMapper;
import com.fengchao.model.usr.UsrUserFavorite;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UsrUserFavoriteMapper extends BaseMapper<UsrUserFavorite> {

    /**
     * 根据type和userId和外键查询用户收藏的信息(foreignId为空 所有)
     * @param type
     * @param userId
     * @param foreignId
     * @return
     */
    List<UsrUserFavorite> findUsrUserFavoriteByTypeUserIdForeignId(@Param("type") String type,@Param("userId") Integer userId,@Param("foreignId") Integer foreignId);

    /**
     * 根据type和userId和外键查询删除
     * @param type
     * @param userId
     * @param foreignId
     * @return
     */
    Integer deleteUsrUserFavoriteByTypeUserIdForeignId(@Param("type") String type,@Param("userId") Integer userId,@Param("foreignId") Integer foreignId);

}